package com.glance.browser.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Size;

@Entity
@Table(name="User")
public class User implements Serializable {

	private static final long serialVersionUID = -1591126204791831801L;
	
	// Persistent Fields:
    @Id 
    @Column(name = "username", length = 45)
    @Size(min=1)
    private String username;
    
    @Column(name = "password", length = 45)
    @Size(min=1)
    private String password;
    
    @Column(name = "access", columnDefinition = "int default 1")
    private int access = 1;
  
    // Constructors:
    public User() {
    }

    public User(String username, String password) {
        this.username = username;
        this.password = password;
     }
    
    public User(String username, String password, int access) {
       this.username = username;
       this.password = password;
       this.access = access;
    }

    // String Representation:
    @Override
    public String toString() {
        return username;
    }

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public int getAccess() {
		return access;
	}

	public void setAccess(int access) {
		this.access = access;
	}
    
    

}
